package one;
 abstract class  animl{
    private String name;
    private int age;
    public animl(String name,int age)
    {
        this.name=name;
        this.age=age;
    }

    public String getName() {
        return name;
    }
    public int age()
    {
        return age;
    }
    public void setName(String name)
    {
        this.name=name;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public abstract void behavier();
}
class frog extends animl
{
    public frog(String name, int age) {
        super(name, age);
    }
    public void behavier()
    {
        System.out.println("吃虫子，喝水");
    }
}
class dog extends animl
{
    public dog(String name, int age) {
        super(name, age);
    }
    public void behavier()
    {
        System.out.println("吃骨头，喝水");
    }
}
class sheep extends animl
{

    public sheep(String name, int age) {
        super(name, age);
    }
    public void behavier()
    {
        System.out.println("吃草，喝水");
    }
}
public class three {
    public static void main(String[] args) {
        frog f=new frog("xiaoai",18);
        f.behavier();
        dog d= new dog("xiaogou",12);
        d.behavier();
        sheep s=new sheep("xiaoyang ",19);
        s.behavier();
    }

}
